package com.ruoyi.common.enums;

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;

import java.io.IOException;

public class BaseIntegerSerializer  extends StdSerializer<BaseInteger> {

    public BaseIntegerSerializer() {
        super(BaseInteger.class);
    }

    @Override
    public void serialize(BaseInteger value, JsonGenerator gen, SerializerProvider provider)
            throws IOException {
        gen.writeNumber(value.getCode());
    }
}